<template>
  <div class="x-i-view-dialog">
    <Modal v-bind="$attrs" v-on="$listeners" v-model="_dialogVisible">
      <template #header v-if="mTitle">
        <p>{{ mTitle }}</p>
      </template>
      <slot></slot>
      <template #footer>
        <div v-if="defaultFooter">
          <Button @click="_dialogVisible = false">取 消</Button>
          <Button type="primary" @click="$emit('dialogFixHandle')"
            >确 认</Button
          >
        </div>
        <div v-else>
          <Button type="primary" @click="_dialogVisible = false">关 闭</Button>
        </div>
      </template>
    </Modal>
  </div>
</template>

<script>
export default {
  name: "Ids26AdminH5Dialog",
  props: {
    defaultFooter: {
      type: Boolean,
      default: () => true,
    },
    dialogVisible: {
      type: Boolean,
      default: () => false,
    },
    mTitle: {
      type: String || Number,
      default: () => "",
    },
  },

  computed: {
    _dialogVisible: {
      get() {
        return this.dialogVisible;
      },
      set(newVal) {
        this.$emit("update:dialogVisible", newVal);
      },
    },
  },
};
</script>

<style lang="scss" scoped></style>
